home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / archival / ftp / holefixes / wormfixes.sun.2 < prev    next >
Encoding:
Internet Message Format  |  1988-11-21  |  8.5 KB

  1. Date: Mon, 21 Nov 88 14:12:51 MST
  2. From: wrl@Ford-cos2.ARPA (Bill Lewandowski)
  3. Subject: More Official Sun Microsystems Virus Patches.
  4.  
  5.  
  6. The following id forwarded For Your Information..
  7.  
  8. Bill
  9.  
  10.  
  11. Date:    Wed, 16 Nov 88 14:44:53 PST
  12. From:    chuq@sun.com (Chuq Von Rospach)
  13. Subject: Official Sun-approved virus patch
  14.  
  15. The following modifications have been approved by Sun Microsystems
  16. Customer Support to fix the current Internet Virus problem.  This is a
  17. set of patches designed to prevent the propagation of the Internet
  18. 'worm' that has infected Sun-3 and Vax computers. There are two parts to
  19. this fix:
  20.  
  21.     1) an adb patch that closes a security hole in sendmail.
  22.     2) a new version of the file /usr/etc/in.fingerd.
  23.  
  24. This is the second release of the patch, updated 11/16/88 to clean up
  25. the sendmail instructions and strengthen the patch to sendmail based on
  26. further feedback from Berkeley.
  27.  
  28. If you have any questions about this patch or if the instructions don't
  29. match what you see, contact Sun Microsystems Customer Support via the
  30. 800-USA4SUN phone number, via the hotline@sun.com e-mail address, or send
  31. e-mail to Chuq Von Rospach at chuq@sun.com (uucp form: ..!sun!chuq). 
  32.  
  33. A few notes on the worm. It affects only machines with SMTP-based
  34. connections to computer networks. If your machines are not connected to
  35. outside organizations or are connected only by uucp, you are not at
  36. risk and you may choose to not install these patches. If you do have a
  37. connection with an outside organization (either on the Internet or with
  38. an organization that might have an Internet connection) you are
  39. potentially at risk to infestation. The connections with potential risk
  40. are those that allow you to access another system via commands like
  41. rlogin or telnet. If that is not possible, you are not at risk.
  42.  
  43. This worm is benign. It's primary purpose is to find other systems in which
  44. to replicate. It does no damage to your system other than sapping system 
  45. resources. Under some circumstances, it can make systems crash due to
  46. resource exhaustion, but otherwise causes few problems.
  47.  
  48. The worm was specifically targeted at Sun-3 and Vax computers. While the
  49. security hole exists on Sun-2 and Sun-4 machines, they are not at risk from
  50. the current virus. We recommend that you install these patches on any
  51. machine that acts as a gateway between your organization and the rest of the
  52. network and on any machine whose network address is publicly available to
  53. the Internet. We recommend installing these patches on every machine. These
  54. patches are not Sun-specific, they should work for all Berkeley-based Unix
  55. systems.
  56.  
  57. These patches will work on Sun-2, Sun-3 and Sun-4 machines under releases
  58. 3.x and 4.0 and 386i machines under 4.0. Only Sun-3 machines are at risk
  59. from the current worm, but all machines are potentially at risk for
  60. future variations of this attack, so every system should be corrected.
  61.  
  62. Patching sendmail:
  63.  
  64. The following instructions should be used to fix the security hole in 
  65. sendmail:
  66.  
  67.     1) log onto the system as root.
  68.     2) make a copy of sendmail.
  69.         # cd /usr/lib
  70.         # cp sendmail sendmail.debug
  71.         # chown daemon sendmail.debug
  72.         # chmod 400 sendmail.debug
  73.     3) kill off your sendmail daemon.
  74.         # ps -ax | grep sendmail
  75.         1563 ?  I     0:00 /usr/lib/sendmail -bd -q17m
  76.         1849 p4 S     0:00 grep -i sendmail
  77.         # kill 1563 [Note: process number will vary. Use the 
  78.                  value returned from ps]
  79.     4) find the offset for the debug and showq options in sendmail.
  80.         # strings -o -a sendmail | egrep debug
  81.         124882 debug
  82.         # strings -o -a sendmail | egrep showq
  83.         100508 showq
  84.        [note: this number will vary depending on architecture and
  85.         release. Make sure you use the number appropriate for your
  86.         system.]
  87.     5) start adb.
  88.         # adb -w sendmail
  89.        [adb does not print user prompts. Just type at it. Note: If adb
  90.         returns the message "warning: sendmail read-only" you didn't
  91.         kill the daemon and adb will not allow you to write into the
  92.         binary of a program that's active.]
  93.     6) put adb into base 10.
  94.         [type the string:] ?m 0 0xffffffff 0
  95.         [there is no response from adb]
  96.         [type the string:] 0t10$d
  97.         [adb responds:] radix=10 base ten
  98.     7) verify the address of the of the debug option.
  99.         [type the string:] 124882?s
  100.         [adb should respond:] 124882:        debug
  101.        [note: make sure you use the correct number for your system here.
  102.         adb may respond with a hex address instead of a decimal address.
  103.         That's okay. Continue with the patch as long as the string
  104.         says 'debug']
  105.     8) disable the debug option.
  106.         [type the string:] 124882?w 65535 0
  107.         [adb should respond:] 124882:        25701    =      65535
  108.                       124886:            25205   =      0
  109.        [note: make sure you use the correct number for your system here.
  110.        if adb responds with hex addresses, that's okay as long as the
  111.        values modified are 25701 to 65535 and 25205 to 0]
  112.     9) verify the address of the of the showq option.
  113.         [type the string:] 100508?s
  114.         [adb should respond:] 100508:        showq
  115.        [note: make sure you use the correct number for your system here.
  116.         adb may respond with a hex address instead of a decimal address.
  117.         That's okay. Continue with the patch as long as the string
  118.         says 'showq']
  119.     10) disable the showq option.
  120.         [type the string:] 100508?w 65535 0
  121.         [adb should respond:] 100508:        29544    =      65535
  122.                       124886:            28535   =      0
  123.        [note: make sure you use the correct number for your system here.
  124.        if adb responds with hex addresses, that's okay as long as the
  125.        values modified are 29544 to 65535 and 28535 to 0. What we have
  126.        done is disable both the 'debug' and 'showq' options in such a
  127.        way that anyone trying to use this security hole gets shunted
  128.        into the 'showq' function, which is harmless.]
  129.     11) exit adb:
  130.         ^D
  131.         #
  132.     12) restart your sendmail daemon.
  133.         # /usr/lib/sendmail -bd -q17m
  134.  
  135.     13) verify the debug option is disabled.
  136.         # /usr/etc/mconnect
  137.         connecting to host localhost (127.0.0.1), port 25
  138.         connection open
  139.         220 [system dependent header information here]
  140.         [type: ] debug
  141.         500 Command unrecognized
  142.         [type: ] showq
  143.         500 Command unrecognized
  144.         [type: ] quit
  145.         221 plaid.Sun.COM closing connection
  146.  
  147. Installing a new fingerd:
  148.  
  149. Attached to the end of this message is a new version of the program
  150. /usr/etc/in.fingerd. This version fixes a security hole in that program.
  151.  
  152. To install this on your system, save the program to a file named
  153. in.fingerd.c. Then compile the program with:
  154.  
  155.     % cc -O  -o in.fingerd in.fingerd.c
  156.  
  157. Install the new fingerd as follows:
  158.  
  159.     % su
  160.     # cp in.fingerd /usr/etc/in.fingerd.new
  161.     # cd /usr/etc
  162.     # mv in.fingerd in.fingerd.orig
  163.     # mv in.fingerd.new in.fingerd
  164.     # chown root in.fingerd
  165.     # chmod 755 in.fingerd
  166.  
  167. Then reboot your system to re-initialize the daemons.
  168.  
  169. ----- Begin of file in.fingerd.c -----
  170. /*
  171.  * Copyright (c) 1983 Regents of the University of California.
  172.  * All rights reserved.  The Berkeley software License Agreement
  173.  * specifies the terms and conditions for redistribution.
  174.  */
  175.  
  176. #ifndef lint
  177. char copyright[] =
  178. "@(#) Copyright (c) 1983 Regents of the University of California.\n\
  179.  All rights reserved.\n";
  180. #endif not lint
  181.  
  182. #ifndef lint
  183. static char sccsid[] = "@(#)in.fingerd.c 1.4 88/02/08 SMI"; /* from UCB 5.1 6/6/85 */
  184. #endif not lint
  185.  
  186. /*
  187.  * Finger server.
  188.  */
  189. #include <sys/types.h>
  190. #include <netinet/in.h>
  191.  
  192. #include <stdio.h>
  193. #include <ctype.h>
  194.  
  195. main(argc, argv)
  196.     char *argv[];
  197. {
  198.     register char *sp;
  199.     char line[512];
  200.     struct sockaddr_in sin;
  201.     int i, p[2], pid, status;
  202.     FILE *fp;
  203.     char *av[4];
  204.  
  205.     i = sizeof (sin);
  206.     if (getpeername(0, &sin, &i) < 0)
  207.         fatal(argv[0], "getpeername");
  208.     line[0] = '\0';
  209.     (void) fgets(line, sizeof(line), stdin);
  210.     sp = line;
  211.     av[0] = "finger";
  212.     i = 1;
  213.     while (1) {
  214.         while (isspace(*sp))
  215.             sp++;
  216.         if (!*sp)
  217.             break;
  218.         if (*sp == '/' && (sp[1] == 'W' || sp[1] == 'w')) {
  219.             sp += 2;
  220.             av[i++] = "-l";
  221.         }
  222.         if (*sp && !isspace(*sp)) {
  223.             av[i++] = sp;
  224.             while (*sp && !isspace(*sp))
  225.                 sp++;
  226.             *sp = '\0';
  227.         }
  228.     }
  229.     av[i] = 0;
  230.     if (pipe(p) < 0)
  231.         fatal(argv[0], "pipe");
  232.     if ((pid = fork()) == 0) {
  233.         close(p[0]);
  234.         if (p[1] != 1) {
  235.             dup2(p[1], 1);
  236.             close(p[1]);
  237.         }
  238.         execv("/usr/local/finger", av);
  239.         execv("/usr/ucb/finger", av);
  240.         printf("No local finger program found\n");
  241.         fflush(stdout);
  242.         _exit(1);
  243.     }
  244.     if (pid == -1)
  245.         fatal(argv[0], "fork");
  246.     close(p[1]);
  247.     if ((fp = fdopen(p[0], "r")) == NULL)
  248.         fatal(argv[0], "fdopen");
  249.     while ((i = getc(fp)) != EOF) {
  250.         if (i == '\n')
  251.             putchar('\r');
  252.         putchar(i);
  253.     }
  254.     fclose(fp);
  255.     while ((i = wait(&status)) != pid && i != -1)
  256.         ;
  257.     return(0);
  258. }
  259.  
  260. fatal(prog, s)
  261.     char *prog, *s;
  262. {
  263.  
  264.     fprintf(stderr, "%s: ", prog);
  265.     perror(s);
  266.     exit(1);
  267. }
  268. ----- end of in.fingerd.c -----
  269.  
  270. ----- end of virus patch message -----
  271.  
  272. ------------------------------
  273.  
  274.